namespace IIS_Local4.Models
{
    using System;
    using System.Data.Entity;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Linq;

    public partial class Model1 : DbContext
    {
        public Model1()
            : base("name=Model1")
        {
        }

        public virtual DbSet<container> containers { get; set; }
        public virtual DbSet<Location_table> Location_table { get; set; }
        public virtual DbSet<PRO_LOGIN> PRO_LOGIN { get; set; }
        public virtual DbSet<product> products { get; set; }
        public virtual DbSet<productplan_put> productplan_put { get; set; }
        public virtual DbSet<sysdiagram> sysdiagrams { get; set; }
        public virtual DbSet<Work> Works { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<container>()
                .Property(e => e.container_name)
                .IsUnicode(false);

            modelBuilder.Entity<Location_table>()
                .Property(e => e.location)
                .IsUnicode(false);

            modelBuilder.Entity<Location_table>()
                .Property(e => e.location_set)
                .IsUnicode(false);

            modelBuilder.Entity<Location_table>()
                .Property(e => e.location_sub)
                .IsUnicode(false);

            modelBuilder.Entity<Location_table>()
                .HasMany(e => e.productplan_put)
                .WithRequired(e => e.Location_table)
                .WillCascadeOnDelete(false);

            modelBuilder.Entity<PRO_LOGIN>()
                .Property(e => e.ID)
                .IsUnicode(false);

            modelBuilder.Entity<PRO_LOGIN>()
                .Property(e => e.PASSWD)
                .IsUnicode(false);

            modelBuilder.Entity<product>()
                .Property(e => e.product_name)
                .IsUnicode(false);

            modelBuilder.Entity<product>()
                .Property(e => e.product_changed_number)
                .IsUnicode(false);

            modelBuilder.Entity<product>()
                .Property(e => e.product_description)
                .IsUnicode(false);

            modelBuilder.Entity<product>()
                .HasMany(e => e.productplan_put)
                .WithRequired(e => e.product)
                .WillCascadeOnDelete(false);

            modelBuilder.Entity<productplan_put>()
                .Property(e => e.location)
                .IsUnicode(false);

            modelBuilder.Entity<productplan_put>()
                .Property(e => e.productplan)
                .IsUnicode(false);

            modelBuilder.Entity<productplan_put>()
                .Property(e => e.product_name)
                .IsUnicode(false);

            modelBuilder.Entity<productplan_put>()
                .Property(e => e.productplan_code)
                .IsUnicode(false);

            modelBuilder.Entity<Work>()
                .Property(e => e.work_order_number)
                .IsUnicode(false);

            modelBuilder.Entity<Work>()
                .Property(e => e.work_place)
                .IsUnicode(false);
        }
    }
}
